<template>
	<view class="content">
		<swiper class="swiper" 
		:autoplay="autoplay" 
		:duration="duration"
		indicator-dots="true">
			<swiper-item>
				<view class="swiper-item">
					<view class="swiper-item-img"><image src="/static/image/yd1.png" mode="aspectFit"></image></view>
					<!-- <view class="swiper-item-img"><image src="../../static/guide/icon_01.png" mode="aspectFit"></image></view> -->
				</view>
				<view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
			</swiper-item>
			<swiper-item>
				<view class="swiper-item">
					<view class="swiper-item-img"><image src="/static/image/yd2.png" mode="aspectFit"></image></view>
					<!-- <view class="swiper-item-img"><image src="../../static/guide/icon_02.png" mode="aspectFit"></image></view> -->
				</view>
				<view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
			</swiper-item>
			<swiper-item>
				<view class="swiper-item">
					<view class="swiper-item-img"><image src="/static/image/yd3.png" mode="aspectFit"></image></view>
					<!-- <view class="swiper-item-img"><image src="../../static/guide/icon_03.png" mode="aspectFit"></image></view> -->
				</view>
				<view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
			</swiper-item>
			<swiper-item>
				<view class="swiper-item" @tap="launchFlag()">
					<view class="swiper-item-img"><image src="/static/image/yd4.png" mode="aspectFit"></image></view>
					<!-- <view class="swiper-item-img"><image src="../../static/guide/icon_04.png" mode="aspectFit"></image></view> -->
				</view>
				<!-- <view class="experience" @tap="launchFlag()">{{experience}}</view> -->
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default {
		computed: {
			...mapState(['hasLogin','userInfo','openId','apiUrl','pid'])
		},
		data() {
			return {
				background: ['color1', 'color2', 'color3'],
				autoplay: false,
				duration: 500,
				jumpover: '跳过',
				experience: '立即体验'
			}
		},
		methods: {
			launchFlag: function(){
				/**
				 * 向本地存储中设置launchFlag的值，即启动标识；
				 */
				uni.setStorage({
						key: 'launchFlag',
						data: true,
				});
				if(this.hasLogin == false){
					uni.navigateTo({
					  url: '/pages/apppersonal/phonelogin'
					});
				}else{
					uni.switchTab({
						url: '/pages/index/index'
					});
				}
			}
		}
	}
</script>
<style>
	page,
	.content{
		width: 100%;
		height: 100%;
		background-size: 100% auto ;
		padding: 0;
	}
	.swiper{
		width: 100%;
		height: 100%;
		background: #FFFFFF;
	}
	.swiper-item {
		width: 100%;
		height: 100%;
		text-align: center;
		position: relative;
		display: flex;
		/* justify-content: center; */
		align-items:flex-end;
		flex-direction:column-reverse
	}
	.swiper-item-img{
		width: 100%;
		height: 100%;
		margin: 0 auto;
	}
	.swiper-item-img image{
		width:100%;
		height: 100%;
	}
	
	
	.jump-over,.experience{
		position: absolute;
		height: 40upx;
		line-height: 40upx;
		width: 90rpx;
		border-radius: 30upx;
		font-size: 24upx;
		color: #666666;
		border: 1px solid #666666;
		z-index: 999;
		text-align: center;
	}
	.jump-over{
		right: 20upx;
		top: 60upx;
	}
	.experience{
		right: 50%;
		margin-right: -105upx;
		bottom: 0;
	}
</style>
